Now Available!

Native .Net
Components

TList WinForms
for
.Net Framework

&

MetaDraw WinForms
for
.Net Framework



Bennet-Tec
Components
Make you
look sharp!



Home

Company

Products

Order Forms

How To

Downloads

Updates

Support

Registration

Dependencies

Links

Compatibility

Site Map


Basic How To


How To Print Page Numbers in the Footer

Download VB Sample
Return to main How To Page

Adding Page Numbers to the Footer Section

ALLText 4 supports the definition of Headers and Footers to be stored with the document. Headers and footers may be defined for the document as a whole, for even pages, for odd pages, or for the first page. To create a Header or footer set the appropriate HeaderFText or FooterFText property, Note that these are list properties.

Thus :

HeaderFText (0) - specifies a header for the document as a whole.
HeaderFText (1) - specifies a header for even pages.
HeaderFText (2) - specifies a header for odd pages.
HeaderFText (3) - specifies a header for the first page.

These properties actually hold the Formatted text string corresponding to the header or footer. If you read in an RTF file with headers or footers, the headers and footers will NOT be shown in ALLText, but will be interpreted and stored by the HeaderFText and FooterFText properties. You can if you wish then add this text to secondary ALLText boxes.

PageNumber Property

Description: Sets or Returns the current page number of the document. Page numbering begins at 0.

Syntax:

ALLText.PageNumber = n%
n% = ALLText.PageNumber

Access:
Read Write
Design - -
Run + +

Remarks: If text is not formatted using the printer device context (ALLText.PrinterDc = False) , ALLText assumes that the contents of the control occupy a single page with length equal to MAX_LONG. In this case, the value of the PageNumber property is always equal to zero.

Setting this property repositions the caret to the specified page number.

PrinterDc Property

Description: Determines whether ALLText uses the Printer Device Context for formatting text on the screen. If this property is set to TRUE the hard copy output and the display will be the same (True WYSIWYG). If set to FALSE, ALLText uses the proper device context for the screen resulting in an enhanced on-screen presentation. (this may cause the on-screen word wrapping to be different from printed word wrapping.

Syntax:

ALLText.PrinterDC = Boolean
b% = ALLText.PrinterDC

Default: False

DataType: Boolean

Access:
Read Write
Design + +
Run + +

Remarks: The following properties are affected by setting of the PrinterDC property.

PageHeight - always set to Max_Long, if PrinterDC = False
PageLineNumber - is equal to LineNumber, if PrinterDC = False
PageNumber - is set to 0 , if PrinterDC = False

FooterFText Property

Description: Contains document Footer that set by the user or read from document file.

Access:
Read Write
Design - -
Run + +

Values: Set footer for the corresponding page ( Doc, Left pages, Right pages or First page)

Reading

S$ = atx.FooterFText(0) - returns Footer for document
S$ = atx.FooterFText(1) - returns Footer for left (even) pages
S$ = atx.FooterFText(2) - returns Footer for right (odd) pages
S$ = atx.FooterFText(3) - returns Footer for first page

Setting

atx.FooterFText(n%) = s$

Constants:

Global Const ATX_FOOTER_SIMPLE = 0
Global Const ATX_FOOTER_LEFT = 1 (even pages)
Global Const ATX_FOOTER_RIGHT = 2 (odd pages)
Global Const ATX_FOOTER_FIRST = 3


Copyright© 2003 Bennet-Tec Information Systems, Inc. All rights reserved.